<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />

</head>

<body>

</body>
<script type="text/javascript" src="../script/api.js"></script>
<script>
apiready = function(){

api.openFrameGroup ({
    name: 'group1',
    background: '#fff',
    scrollEnabled: false,
      preload:2,
    rect: {
         x: 0,
         y: 0,
         w: 'auto',
         h: api.winHeight-60

    },
    index: 0,
    frames: [{
        name: 'frame1',
        url: 'first.html',
        bgColor: '#fff'
    },{
        name: 'frame2',
        url: 'forum/forum.html',
        bgColor: '#fff'
    },{
        name: 'frame3',
        url: 'mycollege.html',
        bgColor: '#fff'
    }]
}, function(ret, err){
  var index=api.index;
});



  var NVTabBar = api.require('NVTabBar');
  NVTabBar.open({
    styles: {
        bg: '#ffffff',
        //bg:"widget://image/NVTabBar/tabbar_bg.png",
        h: 50,
        dividingLine: {
            width: 0.5,
            color: '#000'
        },
        badge: {
            bgColor: '#ffffff',
            numColor: '#fff',
            size: 6.0,
            centerX: 40,
            centerY: 6
        }
    },
    items: [{
        w: api.winWidth / 3.0,
        bg: {
            marginB: 0,
            image: '#ffffff'
        },
        iconRect: {
            w: 25.0,
            h: 25.0,
        },
        icon: {
            normal: 'widget://image/home.png',
            highlight: 'widget://image/home1.png',
            selected: 'widget://image/home1.png'
        },
        title: {
            text: '首页',
            size: 10.0,
            normal: '#696969',
            selected: '#696969',
            marginB: 6.0
        }
    }, {
        w: api.winWidth / 3.0,
        bg: {
            marginB: 0,
            image: '#ffffff'
        },
        iconRect: {
            w: 25.0,
            h: 25.0,
        },
        icon: {
            normal: 'widget://image/text.png',
            highlight: 'widget://image/text1.png',
            selected: 'widget://image/text1.png'
        },
        title: {
            text: '学习论坛',
            size: 10.0,
            normal: '#696969',
            selected: '#696969',
            marginB: 6.0
        }
    }, {
        w: api.winWidth / 3.0,
        bg: {
            marginB: 0,
            image: '#ffffff' //中间背景图
        },
        iconRect: {
          w: 25.0,
          h: 25.0,
        },
        icon: {
            normal: 'widget://image/my3.png',
            highlight: 'widget://image/my2.png',
            selected: 'widget://image/my2.png'
        },
        title: {
            text : '我的大学',
            size: 10.0,
            normal: '#696969',
            selected: '#696969',
            marginB: 6.0
        }
    }],
    fixedOn: api.frameName,
    fixed: false
  }, function(ret, err) {
        if (ret) {
              if (ret.index==0) {
                api.setFrameGroupIndex({
                  name:'group1',
                  index:0
                });
                api.setFrameAttr({
                   name:'home-frame',
                   hidden:false
                })
              }
              if (ret.index==1) {
                api.setFrameGroupIndex({
                  name:'group1',
                  index:1
                });
                api.setFrameAttr({
                   name:'home-frame',
                   hidden:true
                })
              }
              if (ret.index==2) {
                api.setFrameGroupIndex({
                  name:'group1',
                  index:2
                });
                api.setFrameAttr({
                   name:'home-frame',
                   hidden:true
                })
              }
        }
        else {
          alert(JSON.stringify(err));
        }
  });
}

</script>


</html>
